// $URL: http://mingw-lib.googlecode.com/svn/trunk/working/avcodec_to_widget_10/t_youtube.h $
// $Rev: 322 $
// $Author: akio.miyoshi $
// $Date:: 2010-07-31 14:55:07 +0000#$

#ifndef T_YOUTUBE_H
#define T_YOUTUBE_H

#include "stable.h"

class T_Youtube
{
protected:
    bool m_own_nam;
    QNetworkAccessManager *m_nam;
public:
    T_Youtube(QNetworkAccessManager *a_nam = 0);
    ~T_Youtube();
    QString getVideoStreamMap(QString a_id, QMap<int, QUrl> &a_fmt_map);
    QUrl getVideoStreamUrl(QString a_id, int a_fmt);
protected:
    QByteArray batchGet(const QString &a_url);
    QString getTokenForVideoStreamEmbed(QString a_id, QMap<int, QUrl> &a_fmt_map);
    QString getTokenForVideoStreamDetail(QString a_id, QMap<int, QUrl> &a_fmt_map);
};

#endif // T_YOUTUBE_H
